<template>
	<view @click="time()">audio</view>
</template>

<script>
	const innerAudioContext = uni.createInnerAudioContext();
export default {
	data() {
		return {
			current: {
				poster: 'https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-uni-app-doc/7fbf26a0-4f4a-11eb-b680-7980c8a877b8.png',
				name: '致爱丽丝',
				author: '暂无',
				src: 'https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-hello-uniapp/2cc220e0-c27a-11ea-9dfb-6da8e309e0d8.mp3'
			},
			audioAction: {
				method: 'pause'
			}
		};
	},
	methods: {
		open() {
			
			//innerAudioContext.autoplay = true;
			innerAudioContext.src = 'http://localhost:8888/ruan/file/download/path/李志 - 你离开了南京，从此没有人和我说话_8dedb9e7-0dad-41ce-8959-4b44fb4ce893.mp3';
			innerAudioContext.onPlay(() => {
				console.log('开始播放');
			});
			innerAudioContext.onError(res => {
				console.log(res.errMsg);
				console.log(res.errCode);
			});
		},
		time(){
			//innerAudioContext.currentTime=1000
		}
	},
	created() {
		this.open();
	}
};
</script>

<style lang="less"></style>
